package com.xqc.web.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.xqc.common.utils.XqcWebResult;
import com.xqc.web.client.DemoFacadeClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Api(value = "测试类",description = "类名==》DemoController",tags = {"测试类集合"})
@RequestMapping("/demo")
public class DemoController {

    @Resource
    private DemoFacadeClient demoFacadeClient;

    @GetMapping("/test")
    @ApiOperation(value = "测试方法")
    @SentinelResource("demo.test")
    public XqcWebResult<String> test(){
       return this.demoFacadeClient.test();
    }


    @GetMapping("/sentinel")
    @ApiOperation(value = "sentinel")
    public XqcWebResult<String> sentinel(){
        return this.demoFacadeClient.sentinel();
    }

}
